﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using yncTech.BusinessObjects;

public partial class Admin_Sys_Dic_Dic_CodeTable : AdminBasePage
{
    public string category = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        category = Request.QueryString["cat"] ?? "";
        if (!IsPostBack)
        {
            drpCate.SelectedValue = category;
        }
    }

    protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
    {
        category = drpCate.SelectedValue;
        TSCodeTableCollection codes = new TSCodeTableCollection();
        codes.Query.Where(codes.Query.CodeCategory == drpCate.SelectedValue);
        codes.Query.OrderBy(codes.Query.CodeSequence.Ascending);

        pageGrid.DataSource = codes.Query.LoadDataTable();
        pageGrid.CurrentPage = e.NewPageIndex;
        pageGrid.DataBind();
    }
}